﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CognisessWeb.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult BackToHome()
        {
            return RedirectToAction("Index");
        }

    }

    public class LoginFilterAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (filterContext.HttpContext.Session["User"] == null)
            {

                filterContext.HttpContext.Response.Redirect(((Controller)filterContext.Controller).Url.Action("Login", "Account"));
            }
        }
    }
}
